﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FySystem.Net.IOT.CommandSender
{
    public class CmdInfo<T>
    {
        internal DeviceR<T> DeviceR { get; set; }

        public byte[] Command { get; set; }

        /// <summary>
        /// 需要重发多少次
        /// </summary>
        public int Repeat { get; set; }

        internal int SplitTime { get; set; }

        /// <summary>
        /// 超时时间
        /// </summary>
        internal int Timeout { get; set; }

        /// <summary>
        /// 发送次数，用于失败重发
        /// </summary>
        public int SendCnt { get; set; } = 0;

        internal bool NeedReply { get; set; } = true;

        /// <summary>
        /// 是否完成
        /// </summary>
        internal bool IsComplete { get; set; } = false;

        /// <summary>
        /// 下一条指令
        /// </summary>
        internal CmdInfo<T> NextCommand { get; set; } = null;
    }
}
